package com.intellagric.controller.portal.iftmonitor;

import com.intellagric.common.pojo.LayuiDataGridResult;
import com.intellagric.common.pojo.ResponseMessage;
import com.intellagric.pojo.IftEquipmentType;
import com.intellagric.service.iftmonitor.ift_equipment.EquipmentTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Date;
import java.util.List;
import java.util.UUID;

/**
 * @Author: zhy
 * @email: 1269679946@qq.com
 * @Date: 2018/10/20
 * @DESC： 设备分类管理
 */
@Controller
public class EquipmentTypeController {

    @Autowired
    private EquipmentTypeService equipmentTypeService;

    /**
     * 查询设备分类信息
     * @return IftEquipmentType
     */
    @RequestMapping("/equipment/type/{id}")
    @ResponseBody
    public IftEquipmentType get(@PathVariable String id) {
        return equipmentTypeService.getEquipmentTypeById(id);
    }

    /**
     * 查询设备分类树信息
     * @return LayuiDataGridResult
     */
    @RequestMapping("/equipment/type/tree")
    @ResponseBody
    public LayuiDataGridResult getTree() {
        return equipmentTypeService.getEquipmentTypeTree();
    }

    /**
     * 查询设备分类树信息
     * @return LayuiDataGridResult
     */
    @RequestMapping("/equipment/type/tree/select")
    @ResponseBody
    public List<IftEquipmentType> getTreeSelect() {
        return equipmentTypeService.getEquipmentTypeTree().getData();
    }

    /**
     * 查询设备分类信息列表
     * @return LayuiDataGridResult
     */
    @RequestMapping("/equipment/type/list")
    @ResponseBody
    public LayuiDataGridResult getList() {
        return equipmentTypeService.getEquipmentTypeList();
    }

}
